<td>
	<div class="form-group text-center">
		<div class="checkbox">
			<input <% if(parseInt(user.attributes.role_id) === 1 ){ %>disabled <%}%> id="<%- user.attributes.id%>" name="<%- user.attributes.username %>" value="<%- user.attributes.id%>" class="<% if(user.attributes.role_id != 1){%>js-checkbox-list<%}%><%if(parseInt(user.attributes.is_active) === 1){%> js-checkbox-active<%}else{%> js-checkbox-inactive<%}%><% if(!user.attributes.is_email_confirmed){ %> js-checkbox-unconfirmed<%}%>" type="checkbox">
			<label class="js-update-user" data-user_id="<%- user.attributes.id %>" for="<%- user.attributes.id%>"></label>
		</div>
	</div>
</td>
<td>
	<div class="admin-user-table-width">
		<div class="row">
			<div class="col-xs-12">
				<div class="clearfix">
					<a title="<%- user.attributes.full_name%> (<%- user.attributes.username%>)" class="small-user pull-left show" href="#/user/<%- user.attributes.id%>">
						<% if(!_.isEmpty(user.attributes.profile_picture_path)){ 
						var profile_picture_path = user.showImage('User', user.attributes.id, 'small_thumb' );
					%>
						<img class="avatar-sm" src="<%- profile_picture_path%>" alt="[Images: <%- user.attributes.username%>]" title="<%- user.attributes.full_name %> (<%- user.attributes.username%>)" />
						<% }else{ %>
						<i class="avatar avatar-color-194 img-rounded avatar-sm" title="<%- user.attributes.full_name%> (<%- user.attributes.username%>)">
							<%- user.attributes.initials%></i>
						<%  } %>
					</a>
					<a class="col-xs-10 htruncate left-mar-sm js-board-name-truncate js-user-view" title="<%- user.attributes.full_name%> (<%- user.attributes.username%>)" data-user_id="<%- user.attributes.id%>"
					 href="#/user/<%- user.attributes.id%>"">
						<%- user.attributes.full_name%> (<%- user.attributes.username%>)</a><a>
						<% if(!user.attributes.is_email_confirmed){ %>
						<span class="label label-warning navbar-right">
							<%- i18next.t('Unconfirmed') %></span>
						<% } %>
						<% if(user.attributes.is_ldap){ %>
						<span class="label label-success navbar-right">LDAP</span>
						<% } %>
					</a>

				</div>
				<div class="clearfix navbar-btn">
					<span class="col-xs-12 htruncate nav">
						<%- user.attributes.email%></span>
				</div>
			</div>
		</div>
	</div>
</td>
<td class="text-center">
	<div class="btn-group text-left navbar-btn dropdown">
		<%- user.attributes.created_organization_count %>
	</div>
</td>
<td class="text-center">
	<div class="btn-group text-left navbar-btn dropdown">
		<%- user.attributes.owner_organization_count%>
	</div>
</td>
<td class="text-center">
	<div class="btn-group text-left navbar-btn dropdown">
		<%- user.attributes.member_organization_count%>
	</div>
</td>
<td class="text-center">
	<div class="btn-group text-left navbar-btn dropdown">
		<%- user.attributes.created_board_count%>
	</div>
</td>
<td class="text-center">
	<div class="btn-group text-left navbar-btn dropdown">
		<%- user.attributes.owner_board_count%>
	</div>
</td>
<td class="text-center">
	<div class="btn-group text-left navbar-btn dropdown">
		<%- user.attributes.member_board_count%>
	</div>
</td>
<td class="text-center">
	<span class="navbar-btn">
		<%- user.attributes.user_login_count%></span>
</td>
<td class="text-center">
	<% if(user.get('last_login_date') !== null){ %>
	<% setInterval(function() { %>
		<% parse_date(user.get('last_login_date'), authuser, 'js-timeago-user-'+user.attributes.id); %>
	<% }, 10000); %>
	<span class="js-timeago-user-<%- user.attributes.id %>"><%= parse_date(user.get('last_login_date'), authuser, 'js-timeago-user-'+user.attributes.id, true) %></span>
	<%}else{%>-
	<%}%>

</td>
<td class="text-center">
	<span class="show">
		<%- user.attributes.last_login_ip%>
	</span>
	<% if(!_.isEmpty(user.attributes.login_country_iso2)){ %>
		<span class="flags flag-<%- user.attributes.login_country_iso2%> top-smspace" title="<%- user.attributes.login_country_name %>">
			<%- user.attributes.login_country_name %>
		</span>
	<% } %>
	<% if(!_.isEmpty(user.attributes.login_city_name)){ %>
		<%- user.attributes.login_city_name %>
	<% } %>
</td>
<td class="text-center">
	<% setInterval(function() { %>
		<% parse_date(user.get('created'), authuser, 'js-timeago-user2-'+user.attributes.id); %>
	<% }, 10000); %>
	<span class="js-timeago-user2-<%- user.attributes.id %>"><%= parse_date(user.get('created'), authuser, 'js-timeago-user2-'+user.attributes.id, true) %></span>
</td>
<td class="text-center">
	<span class="show">
		<%- user.attributes.registered_ip%>
	</span>
	<% if(!_.isEmpty(user.attributes.register_country_iso2)){ %>
		<span class="flags flag-<%- user.attributes.register_country_iso2%> top-smspace" title="<%- user.attributes.register_country_name %>">
			<%- user.attributes.register_country_name %>
		</span>
	<% } %>
	<% if(!_.isEmpty(user.attributes.register_city_name)){ %> <span>
		<%- user.attributes.register_city_name %></span>
	<% } %>
</td>
<% if (!_.isUndefined(APPS) && APPS !== null && !_.isUndefined(APPS.enabled_apps) && APPS.enabled_apps !== null && $.inArray('r_groups',APPS.enabled_apps) !== -1) { %>
	<td class="text-center">
		<div class="dropdown btn-group js-Group-content-dropdown">
			<a  href="#" aria-expanded="false" data-toggle="dropdown" class="btn btn-default btn-xs dropdown-toggle js-group-memeber-count-<%-user.id%>" type="button">
			<% if(!_.isEmpty(user.attributes.groups) && !_.isUndefined(user.attributes.groups)){ %>
				<%-user.attributes.groups.length%>
			<% } else { %>
				0
			<% } %>
			</a>
			<!-- js-admin-list-user-role -->
			<% if (!_.isEmpty(user.overall_groups) && !_.isUndefined(user.overall_groups)) { %>
				<ul class="dropdown-menu arrow arrow-right max-wid" role="menu">
					<% _.each(user.overall_groups, function(group, group_key){ %>
						<li class="text-left js-group-member" data-group_id="<%- group.id %>" data-user_id="<%- user.id %>" data-group_index="<%- group_key %>">
							<a href="#" data-group_id="<%- group.id %>" data-user_id="<%- user.id %>" data-group_index="<%- group_key %>" class="js-group-member" title="<%- group.name %>">
							<span><%- group.name %></span>
							<% var Exists = false, group_user_index; 
								_.each(group.groups_users, function(group_user, group_user_key){
									if(group_user.user_id == user.id){
										Exists = true;
										group_user_index = group_user_key;
										return;
									}
								});
							%>
							<% if(Exists === true){ %>
								<i class="icon-ok js-group-member-check" data-group_user="<%-Exists%>"></i>
							<% } %>
							</a>
						</li>
					<% }); %>
				</ul>
			<% } else { %>
				<div class="dropdown-menu arrow arrow-right max-wid" role="menu">
					<strong class="alert-info"><%- i18next.t('No Groups available') %></strong>
				</div>
			<% } %>
		</div>
	</td>
<% } %>

<td class="text-center devices-td devices-td-new">
	<div class="dropdown btn-group">
		<% _.each(user.roles, function(role){
			if(user.attributes.role_id == role.id){ %>
			<button class="btn btn-default btn-xs" type="button"><%- role.name %></button>
		<% } 
		}); %>
		<button aria-expanded="false" data-toggle="dropdown" class="btn btn-default btn-xs dropdown-toggle" type="button">
			<span class="caret"></span><span class="sr-only"><%- i18next.t("Toggle Dropdown") %></span>
		</button>
		<ul class="dropdown-menu arrow arrow-right js-admin-list-user-role max-wid" role="menu">
			<% _.each(user.roles, function(role) { %>
			<li class="text-left">
				<a href="#" class="<% if(user.attributes.role_id == role.id){%>js-no-action<%}else{%>js-change-user-role<%}%>" data-role-id="<%- role.id %>">
				<%- role.name%>
				<% if(user.attributes.role_id == role.id){ %>
					<i class="icon-ok"></i>
				<% } %>
				</a>
			</li>
			<% }); %>
		</ul>
	</div>
</td>


<td>
	<ul class="list-inline list-group-item-text">
		<li class="navbar-btn"><a href="javascript:void(0);" title="<%- i18next.t('Activities') %>" class="btn btn-default btn-xs js-all-user-activities">
				<%- i18next.t("Activities") %></a></li>

		<li class="navbar-btn">
			<a href="javascript:void(0);" class="btn btn-default btn-xs <%if(parseInt(user.attributes.is_active) === 1){%>js-block-user<%}else{%>js-unblock-user<%}%>"
			 title="<%if(parseInt(user.attributes.is_active) === 1){%><%- i18next.t('Block') %><%}else{%><%- i18next.t('Unblock') %>
				<%}%>" <% if(user.attributes.role_id==1){%> disabled="disabled"
				<% } %>>
				<i class="icon-exclamation"></i>
				<span>
					<%if(parseInt(user.attributes.is_active) === 1){%>
					<%- i18next.t("Block") %>
					<%}else{%>
					<%- i18next.t("Unblock") %>
					<%}%></span></a>
		</li>
		<% if(parseInt(user.attributes.is_ldap) === 0){ %>
		<li class="navbar-btn">
			<div class="dropdown btn-group">
				<button aria-expanded="false" data-toggle="dropdown" class="btn btn-default dropdown-toggle btn-xs" type="button">
					<%- i18next.t("Change Password") %>
				</button>
				<ul class="dropdown-menu arrow arrow-right" role="menu">
					<div class="panel-body well-lg">
						<form role="form" class="js-admin-change-password" name="UserChangePasswordAdminForm" id="UserChangePasswordAdminForm-<%- user.attributes.id %>">
							<div class="form-group input password required">
								<label class="sr-only control-label" for="inputPassword-<%- user.attributes.id %>">
									<%- i18next.t('Enter a new Password') %></label>
								<input type="password" class="form-control" placeholder="<%- i18next.t('Enter a new Password') %>" id="inputPassword-<%- user.attributes.id %>"
								 name="password" required title="<%- i18next.t('Enter a new Password') %>" autocomplete="off">
							</div>
							<div class="form-group input cpassword required">
								<label class="sr-only control-label" for="inputConfirmPassword-<%- user.attributes.id %>">
									<%- i18next.t('Confirm Password') %></label>
								<input type="password" class="form-control" placeholder="<%- i18next.t('Confirm Password') %>" id="inputConfirmPassword-<%- user.attributes.id %>"
								 name="confirm_password" required title="<%- i18next.t('Confirm Password') %>" autocomplete="off">
							</div>
							<div class="form-group">
								<label class="sr-only control-label" for="submitChangePasswordAdmin-<%- user.attributes.id %>">
									<%- i18next.t('Change Password') %></label>
								<input type="submit" class="btn btn-primary col-xs-12" id="submitChangePasswordAdmin-<%- user.attributes.id %>"
								 value="<%- i18next.t('Change Password') %>">
							</div>
						</form>
					</div>
				</ul>
			</div>
		</li>
		<% } else { %>
		<li class="navbar-btn">
			<div class="btn-group">
				<button class="btn btn-default btn-xs js-no-action" disabled type="button">
					<%- i18next.t("Change Password") %>
				</button>
			</div>
		</li>
		<% } %>
		<li class="navbar-btn">
			<span class="dropdown navbar-btn">
				<a aria-expanded="false" data-toggle="dropdown" class="btn btn-primary btn-xs" href="#" <%
				 if(user.attributes.role_id==1){%> disabled="disabled"
					<% } %> >
					<i class="icon-remove"></i>
					<%- i18next.t("Delete") %>
				</a>
				<ul class="dropdown-menu dropdown-menu-right arrow arrow-right col-xs-12">
					<li class="col-lg-12 clearfix text-center">
						<div><span class="col-xs-10"><strong>
									<%- i18next.t("Delete User") + '?' %></strong></span><a class="js-close-popover pull-right" href="#/users"><i
								 class="icon-remove "></i></a></div>
					</li>
					<li class="col-lg-12 divider"></li>
					<li class="col-lg-12 text-left">
						<span class="show">
							<%- i18next.t("Deleting an user is permanent. There is no undo.") %></span>
						<div class="col-xs-12 btn-block navbar-btn"><a title="<%- i18next.t('Delete User') %>" class="js-remove-user"><span
								 class="btn btn-primary">
									<%- i18next.t("Delete") %></span></a></div>
					</li>
				</ul>
		</li>
	</ul>
</td>